package com.mycjj.android.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.mycjj.android.MyCjjApplication;
import com.mycjj.android.R;

public class SettingInfoActivity extends BaseActivity implements android.view.View.OnClickListener{
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_me_settinginfo);
		init();
	}
	
	private ImageView mHeaderLeftImageview;
	private Button mHeaderRightButton;
	private TextView mHeaderTitleTextView;
	private void initHeader(){
		mHeaderLeftImageview = (ImageView) findViewById(R.id.header_left_button);
		mHeaderLeftImageview.setImageResource(R.drawable.back);
		mHeaderRightButton = (Button) findViewById(R.id.header_right_button);
		mHeaderRightButton.setBackgroundResource(R.drawable.heard_menu_style_update);
		mHeaderRightButton.setVisibility(View.INVISIBLE);
		ViewGroup.LayoutParams params = (ViewGroup.LayoutParams)mHeaderRightButton.getLayoutParams();
		params.height = (int)(30 * MyCjjApplication.getInstance().getDisplayDensity());
		params.width = (int)(50 * MyCjjApplication.getInstance().getDisplayDensity());
		mHeaderRightButton.setLayoutParams(params);
		
		mHeaderTitleTextView = (TextView) findViewById(R.id.header_title_textview);
		mHeaderTitleTextView.setText("修改资料");
		mHeaderLeftImageview.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				SettingInfoActivity.this.finish();
			}
		});
	}
	
	private View rl_item01,rl_item02,rl_item03;
	
	private void init(){
		initHeader();
		rl_item01 = findViewById(R.id.rl_item01);
		rl_item02 = findViewById(R.id.rl_item02);
		rl_item03 = findViewById(R.id.rl_item03);
		rl_item01.setOnClickListener(this);
		rl_item02.setOnClickListener(this);
		rl_item03.setOnClickListener(this);
		
	}

	@Override
	public void onClick(View v) {
		Intent intent = new Intent();
		switch(v.getId()){
		case R.id.rl_item01:
			intent.setClass(SettingInfoActivity.this, UserInfoActivity.class);
			break;
		case R.id.rl_item02:
			intent.setClass(SettingInfoActivity.this, FindPwdActivity.class);
			intent.putExtra("title", "修改密码");
			intent.putExtra("type", "4");
			break;
		case R.id.rl_item03:
			intent.setClass(SettingInfoActivity.this, SetTelActivity.class);
			break;
		}
		startActivity(intent);
	}
		
}
